package cn.bdqn.service.impl;

import cn.bdqn.dao.GameDao;
import cn.bdqn.entity.GameCategory;
import cn.bdqn.entity.dto.GameDTO;
import cn.bdqn.service.GameService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.springframework.stereotype.Service;

/**
 * 游戏表(Game)表服务实现类
 *
 * @author makejava
 * @since 2023-10-17 11:24:51
 */
@Service("gameService")
public class GameServiceImpl extends ServiceImpl<GameDao, GameDTO> implements GameService {

    @Override
    public Page<GameDTO> queryAll(Page<GameDTO> page, GameDTO game) {

        MPJLambdaWrapper<GameDTO> wrapper=new MPJLambdaWrapper<GameDTO>()
                .selectAll(GameDTO.class)
                .select(GameCategory::getCategoryName)
                .innerJoin(GameCategory.class,GameCategory::getCategoryId,GameDTO::getGameCategoryId);
        return page(page,wrapper);
    }


}

